package cn.exrick.xboot.modules.content.service;

import cn.exrick.xboot.base.XbootBaseService;
import cn.exrick.xboot.common.vo.Result;
import cn.exrick.xboot.modules.content.entity.HontUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import cn.exrick.xboot.common.vo.SearchVo;

import java.util.List;

/**
 * 娴嬭瘯接口
 * @author Exrick
 */
@CacheConfig(cacheNames = "hontUser")
public interface HontUserService extends XbootBaseService<HontUser, String> {

    /**
     * 多条件分页获取
     * @param hontUser
     * @param searchVo
     * @param pageable
     * @return
     */
    Page<HontUser> findByCondition(HontUser hontUser, SearchVo searchVo, Pageable pageable);
    /**
     * 通过用户名获取用户
     * @param username
     * @return
     */
    HontUser findByUserName(String username);
    /**
     * 通过手机获取用户
     * @param mobile
     * @return
     */
    HontUser findByMobile(String mobile);
    /**
     * 通过邮件和状态获取用户
     * @param email
     * @return
     */
    HontUser findByEmail(String email);
    /**
     * 通过部门id获取
     * @param departmentId
     * @return
     */
    List<HontUser> findByDepartmentId(String departmentId);
    public HontUser cutomerfindByMobile(String mobile);

    HontUser findByNickName(String nickName);

    HontUser findById(String userId);
    List<HontUser> findByPostId(String postId);
    Result<HontUser> addHontUser(HontUser user,String roles,String[] postId) throws Exception;

    /**
     * 获取所有已认证用户
     * @return
     */
    List<HontUser> findByApprove(Integer approve);
    List<HontUser> findByDepartmentIdLike(String departmentId);



}